package com.freedom.admin.application.service.query;

import com.freedom.admin.application.converter.OauthClientConverter;
import com.freedom.admin.domain.repository.OauthClientRepository;
import com.freedom.admin.infrastructure.persistence.pojo.bo.OauthClientBO;
import com.freedom.admin.api.pojo.dto.ClientAuthDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class OauthClientQueryService {

    private final OauthClientRepository oauthClientRepository;

    private final OauthClientConverter oauthClientConverter;

    public ClientAuthDTO findOauthClientById(String clientId) {
        OauthClientBO oauthClientBO = oauthClientRepository.findOauthClientById(clientId);
        return oauthClientConverter.toDTO(oauthClientBO);
    }
}
